package org.layui.test;

import org.layui.dao.UserDao;
import org.layui.dao.impl.UserDaoImpl;
import org.layui.entity.User;

import java.util.List;

public class MainTest02 {
    public static void main(String[] args) {
//         User user = null ;

        User user = new User() ;
        user.setUsername("i");

        queryCount(user);
        queryUser(user);

    }

    private static void queryUser(User user) {
        UserDao userDao = new UserDaoImpl();
        List<User> list = userDao.queryUserByPage(user, 3, 2);
        for(User u : list) {
            System.out.println(u.getName());
        }
    }

    private static void queryCount(User user) {
        UserDao userDao = new UserDaoImpl();
        Long count = userDao.queryUserByPageCount(user) ;
        System.out.println(count);
    }
}
